<?php

require_once("lib/exception/internal_error_exception.php");
require_once("lib/exception/instance_not_found_exception.php");

require_once("lib/model/action.php");
require_once("model/article_category/dao/article_category_dao_factory.php");

class Find_most_importants_categories_action implements Action {

	public function __construct() {}
	
	public function do_execute() {
		try {
			$dao = Article_category_dao_factory::singleton()->get_dao();
			return $dao->find_most_importants(20);				
		}
		catch (Instance_not_found_exception $e) {
			throw new Model_exception($e);
		}
		catch (Internal_error_exception $e) {
			throw $e;
		}
		catch (Exception $e) {
			throw new Exception("Internal error exception --> " . $e);
		}
	}
	
}

?>